Skip to content

feat: add std::string_view overload for Symbol::For#1722

Open
umuoy1 wants to merge 2 commits intonodejs:mainfrom
umuoy1:feat/symbol-for-string-view
Open

feat: add std::string_view overload for Symbol::For#1722
umuoy1 wants to merge 2 commits intonodejs:mainfrom
umuoy1:feat/symbol-for-string-view

Conversation

@umuoy1
Copy link
Copy Markdown
Contributor

@umuoy1 umuoy1 commented Apr 10, 2026

Symbol::For had overloads for const std::string&, const char*, String, and napi_value, but was missing a std::string_view overload. This made it inconsistent with other APIs like String::New which already accept std::string_view, and forced users to convert std::string_view to std::string or const char* before calling Symbol::For.

Adding the std::string_view overload provides a more consistent API surface and avoids unnecessary string copies.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.65%. Comparing base (0add130) to head (cdece99).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1722      +/-   ##
==========================================
+ Coverage   63.61%   63.65%   +0.03%     
==========================================
  Files           3        3              
  Lines        2056     2058       +2     
  Branches      729      729              
==========================================
+ Hits         1308     1310       +2     
  Misses        162      162              
  Partials      586      586              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@umuoy1
Copy link
Copy Markdown
Contributor Author

umuoy1 commented Apr 12, 2026

@legendecas could you take a look at this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Triage

Development

Successfully merging this pull request may close these issues.

2 participants